"use strict";
// 基本用法
// class Animal {
//   move(dsitanceInMeters: number = 0) {
//     console.log(`Animal moved ${dsitanceInMeters}m.`);
//   }
// }
// class Dog extends Animal {
//   bark() {
//     console.log('worf! worf!');
//   }
// }
// const dog =  new Dog()
// dog.bark() // worf! worf!
// dog.move() // Animal moved 0m.
// dog.move(10) // Animal moved 10m.
var __extends = (this && this.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
        return extendStatics(d, b);
    };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
// 继承父类， super关键字必须写在construct构造器的最前面
var Animal = /** @class */ (function () {
    function Animal(theName) {
        this.name = theName;
    }
    Animal.prototype.move = function (dsitanceInMeters) {
        if (dsitanceInMeters === void 0) { dsitanceInMeters = 0; }
        console.log(this.name + " moved " + dsitanceInMeters + "m.");
    };
    return Animal;
}());
var Gender;
(function (Gender) {
    Gender[Gender["male1"] = 1] = "male1";
    Gender[Gender["female1"] = 2] = "female1";
})(Gender || (Gender = {}));
var Snake = /** @class */ (function (_super) {
    __extends(Snake, _super);
    function Snake(name, age, gender) {
        var _this = _super.call(this, name) || this;
        _this.age = age;
        _this.gender = Gender[gender];
        return _this;
    }
    Snake.prototype.move = function (distanceInMeters) {
        if (distanceInMeters === void 0) { distanceInMeters = 5; }
        console.log("\u8FD9" + this.gender + "\u86C7" + this.age + "\u5F88\u6ED1\uFF0C\u8D70\u4F4D\u98CE\u9A9A\uFF01\uFF01");
        _super.prototype.move.call(this, distanceInMeters);
    };
    return Snake;
}(Animal));
var Horse = /** @class */ (function (_super) {
    __extends(Horse, _super);
    function Horse(age, gender) {
        var _this = _super.call(this, name) || this;
        _this.age = age;
        _this.gender = Gender[gender];
        return _this;
    }
    Horse.prototype.move = function (distanceInMeters) {
        if (distanceInMeters === void 0) { distanceInMeters = 45; }
        console.log(this.gender + "\u9A6C\u5F13\u624B" + this.age + "\u5173\u7FBD\u8BF7\u6C42\u51FA\u6218\uFF01\uFF01" + this.name);
        _super.prototype.move.call(this, distanceInMeters);
    };
    return Horse;
}(Animal));
var snake = new Snake('东皇太一', 19, 1);
snake.move(6);
// 这male1蛇19很滑，走位风骚！！
// 东皇太一 moved 6m.
var horse = new Horse(20, 2);
horse.move();
// female1马弓手20关羽请求出战！！
// moved 45m.
